package com.dlnu.shoping.shopping.controller;

import com.dlnu.shoping.shopping.common.Result;
import com.dlnu.shoping.shopping.service.IAdService;
import com.dlnu.shoping.shopping.service.OrderService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/order")
public class OrderController {
    @Resource
    private OrderService orderService;
    @RequestMapping("/search")
    public Result search(@RequestParam Integer userId) {
        return orderService.search(userId);
    }

    @RequestMapping("/add")
    public Result add(@RequestParam Integer userId,@RequestParam Integer addressId,@RequestParam Integer proId) {
        return orderService.add(proId,userId,addressId);
    }
}
